﻿
// DAOTestView.h: CDAOTestView 类的接口
//

#pragma once
#include "RowView.h"


class CDAOTestView : public CRowView
{
protected: // 仅从序列化创建
	CDAOTestView() noexcept;
	DECLARE_DYNCREATE(CDAOTestView)

// 特性
public:
	CDAOTestDoc* GetDocument() const;

// 操作
public:

// 重写
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual void OnInitialUpdate(); // 构造后第一次调用
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// 实现
public:
	virtual ~CDAOTestView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// 生成的消息映射函数
protected:
	DECLARE_MESSAGE_MAP()
private:
	int m_nSelectedRow;
	CDaoRecordset* m_pSet;

public:
	void OnDrawRow(CDC* pDC,int nRowNo,int y,BOOL bSelected);
	void GetRowWidthHeight(CDC* pDC,int& nRowWidth,int& nRowHeight,int& nCharWidth);
	int GetActiveRow();
	int GetRowCount();
	void ChangeSelectionNextRow(BOOL nNext);
	void ChangeSelectionToRow(int nRow);
	virtual void OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/);

private:
	void DrawDataRow(CDC* pDC,int y);


public:
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
	afx_msg void OnTimer(UINT_PTR nIDEvent);
};

#ifndef _DEBUG  // DAOTestView.cpp 中的调试版本
inline CDAOTestDoc* CDAOTestView::GetDocument() const
   { return reinterpret_cast<CDAOTestDoc*>(m_pDocument); }
#endif

